<template>
  <ul class="footer">
      <li
        v-for="(route, index) in tabRouts"
        :key="route.path"
        :class="{active:$route.path == route.path}"
        @click="jump(route.path, index)"
      >
          <i class="iconfont" v-html="route.meta.icon"></i>
          <span>{{ route.meta.title }}</span>
      </li>
  </ul>
</template>

<script>
import routes from '@/router/routes'
export default {
  name: 'Footer',
  data () {
    return {
      currentIndex: 0
    }
  },
  computed: {
    tabRouts () {
      return routes.filter(route => route.meta && route.meta.isTab)
    }
  },
  methods: {
    jump (path, index) {
      this.$router.push(path)
      this.currentIndex = index
    }
  }
}
</script>

<style lang="less" scoped>
@font-face {
  font-family: 'iconfont';  /* project id 2481311 */
  src: url('//at.alicdn.com/t/font_2481311_nfb6g9dp98l.eot');
  src: url('//at.alicdn.com/t/font_2481311_nfb6g9dp98l.eot?#iefix') format('embedded-opentype'),
  url('//at.alicdn.com/t/font_2481311_nfb6g9dp98l.woff2') format('woff2'),
  url('//at.alicdn.com/t/font_2481311_nfb6g9dp98l.woff') format('woff'),
  url('//at.alicdn.com/t/font_2481311_nfb6g9dp98l.ttf') format('truetype'),
  url('//at.alicdn.com/t/font_2481311_nfb6g9dp98l.svg#iconfont') format('svg');
}
.iconfont{
    font-family:"iconfont" !important;
    font-size:16px;font-style:normal;
    -webkit-font-smoothing: antialiased;
    -webkit-text-stroke-width: 0.2px;
    -moz-osx-font-smoothing: grayscale;
}
.footer {
    border-top: 1px solid #eaeaea;
    list-style: none;
    display: flex;
    justify-content: space-around;
    li{
        font-size: 14px;
        display: flex;
        flex-direction: column;
        margin-top: 5px;
        align-items: center;
        color: rgb(138, 132, 132);
        i {
            font-size: 20px;
        }
    }
}
.active {
    color: #02a774 !important;
}
</style>
